﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CavinatorService.DAO.Extensao;
using System.Runtime.Serialization;

namespace CavinatorService.Model
{
    /// <summary>
    /// Classe para representar um item
    /// </summary>
    [DataContract]
    public class Item
    {
        #region Properties

        /// <summary>
        /// Id do item
        /// </summary>
        [DataMember]
        public int Id { get; set; }

        /// <summary>
        /// Item
        /// </summary>
        [DataMember]
        public string Value { get; set; }

        /// <summary>
        /// Lista de respostas do item
        /// </summary>
        [DataMember]
        public List<Answer> Answers { get; set; }

        #endregion

        #region Constructors

        public Item()
        {
            Answers = new List<Answer>();
        }

        public Item(IDataReader drlinha)
        {
            Id = drlinha.VerificarColuna("Id", 0);
            Value = drlinha.VerificarColuna("Value", string.Empty);
            Answers = new List<Answer>();
        }

        #endregion

        #region Methods
        #endregion
    }
}
